package com.warehouse.module.business.dal.mysql.worldCityCode;

import com.warehouse.framework.mybatis.core.mapper.BaseMapperX;
import com.warehouse.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.warehouse.module.business.controller.admin.worldCityCode.vo.WorldCityCodeReqVO;
import com.warehouse.module.business.dal.dataobject.worldCityCode.WorldCityCodeDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface WorldCityCodeMapper extends BaseMapperX<WorldCityCodeDO> {

    default List<WorldCityCodeDO> listWordCode(WorldCityCodeReqVO vo){
        return selectList(new LambdaQueryWrapperX<WorldCityCodeDO>().likeRight(WorldCityCodeDO::getCode, vo.getCode())
            .orderByAsc(WorldCityCodeDO::getCode));
    }
}
